
//Copyright 1997-2009 Syrinx Development, Inc.
//This file is part of the Syrinx Web Application Framework (SWAF).
// == BEGIN LICENSE ==
//
// Licensed under the terms of any of the following licenses at your
// choice:
//
//  - GNU General Public License Version 3 or later (the "GPL")
//    http://www.gnu.org/licenses/gpl.html
//
//  - GNU Lesser General Public License Version 3 or later (the "LGPL")
//    http://www.gnu.org/licenses/lgpl.html
//
//  - Mozilla Public License Version 1.1 or later (the "MPL")
//    http://www.mozilla.org/MPL/MPL-1.1.html
//
// == END LICENSE ==
using System;
using System.Collections.Generic;
using System.Text;

using Swaf.BizObj;

namespace Swaf.Resource
{
	public enum NumericFormats
	{
		Currency,
		Decimal,
		Scientific,
		FixedPoint,
		General,
		Number,
		Percent,
		RoundTrip,
		Hexadecimal
	}
	public enum DateTimeFormats
	{
		ShortDate,
		LongDate,
		ShortTime,
		LongTime,
		ShortDateTime,
		LongDateTime,
		ShortGeneral,
		LongGeneral,
		MonthDay,
		RC1123,
		Sortable,
		UniversalSortable,
		YearMonth
	}
	public enum NumberTypes
	{
		Decimal,
		Double,
		Float,
		Int,
		Long,
		Short,
		UInt,
		ULong,
		UShort
	}

	public interface IGlobalization
	{
		IBizObj CurrentCulture { get;set;}
		string translate(string textKey, string defVal, params object[] replacements);

		string format(DateTime source, DateTimeFormats format);
		string format(short source, NumericFormats format);
		string format(int source, NumericFormats format);
		string format(long source, NumericFormats format);
		string format(double source, NumericFormats format);
		string format(float source, NumericFormats format);
		string format(decimal source, NumericFormats format);
		string format(uint source, NumericFormats format);
		string format(ulong source, NumericFormats format);
		string format(ushort source, NumericFormats format);

		DateTime dateFromString(string source);
		object numberFromString(string source, NumberTypes type);
	}
}
